package cn.gcjxsc.consts;

/**
 * 提现状态.
 *
 * @author pumbaa
 * @since 1.0
 */
public enum WithdrawStatus {
    /**
     * 待审核
     */
    WAIT(0),
    /**
     * 已取消
     */
    CANCELED(1),
    /**
     * 已拒绝
     */
    REJECTED(2),
    /**
     * 已通过
     */
    PASSED(4),
    /**
     * 已完成
     */
    DONE(8);
    private int status;

    WithdrawStatus(int status) {
        this.status = status;
    }

    public int getStatus() {
        return status;
    }

    public static WithdrawStatus fromCode(int status) {
        switch (status) {
            case 1:
                return CANCELED;
            case 2:
                return REJECTED;
            case 4:
                return PASSED;
            case 8:
                return DONE;
            default:
                return WAIT;
        }
    }
}
